package com.salton123.charging.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.salton123.charging.service.SoundService;
import com.salton123.log.XLog;

public class ReStarter extends BroadcastReceiver {
    public static final String RESTART = "com.salton123.chargingtone.restart_sound_service";
    public static final String TAG = "salton-ReStarter";

    public void onReceive(Context context, Intent intent) {
        XLog.i(TAG, "[onReceive] action:" + intent.getAction());
        if (RESTART.equals(intent.getAction())) {
            SoundService.start(context, intent.getBooleanExtra(SoundService.SELF_RESTART, false));
        }
    }
}
